<?php
/**
 * Created by PhpStorm.
 * User: boye009
 * Date: 2016/3/15
 * Time: 10:45
 */

namespace Api\Domain;


use Shop\Api\RedEnvelopeApi;

class RedEnvelopeDomain extends BaseDomain{

    protected $business_code = 'redEnvelope';

    protected $allowType = array("json", "rss", "html");

    public function query(){

        $this->checkVersion(100);
        addLog("RedEnvelope/query",$_GET,$_POST,"应用" . $this->client_id . "调用红包查询接口");

        $uid = $this -> _post('uid',0,"用户id缺失");
        $use_status = $this -> _post('use_status',-1);

        if($use_status === -1){
            $use_status = false;
        }

        $result = apiCall(RedEnvelopeApi::QUERY_WITH_TPL,array($uid,$use_status));

        if($result['status']){
            $this -> apiReturnSuc($result['info']);
        }else{
            $this -> apiReturnErr($result['info']);
        }

    }

}